package com.star.project.cococo.api;

import com.star.common.utils.ServletUtils;
import com.star.framework.web.controller.BaseController;
import com.star.framework.web.domain.AjaxResult;
import com.star.project.cococo.util.CommonUtils;
import com.star.project.system.user.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@RestController
@Api(tags="Api接口")
@RequestMapping("/api")
public class ApiController extends BaseController {

    @Autowired
    private CommonUtils commonUtils;
    @Autowired
    private IUserService userService;

    @ApiOperation("测试")
    @GetMapping("/test")
    @Transactional
    public AjaxResult test() {
        Long userId = ServletUtils.getAttributeToLong("userId");

        return success(userId + ",您好",commonUtils.getUpToken());
    }


}
